﻿namespace Sidvall.UI.Wpf.Test.ViewModels
{
    public sealed class MainWindowViewModel : Sidvall.UI.ViewModels.MainWindowViewModelBase
    {
        #region Public Members

        #region Title

        private string _Title;
        public string Title
        {
            get
            {
                return _Title;
            }
            set
            {
                if (_Title == value)
                    return;
                _Title = value;
                RaisePropertyChanged(nameof(Title));
            }
        }

        #endregion
        #region IsSelected

        private bool? _IsSelected;
        public bool? IsSelected
        {
            get
            {
                return _IsSelected;
            }
            set
            {
                if (_IsSelected == value)
                    return;
                _IsSelected = value;
                RaisePropertyChanged(nameof(_IsSelected));
            }
        }

        #endregion
        #region MenuItems

        private Sidvall.UI.Entities.MenuItemCollection _MenuItems = null;
        public Sidvall.UI.Entities.MenuItemCollection MenuItems
        {
            get
            {
                if (_MenuItems == null)
                {
                    var items = new Sidvall.UI.Entities.MenuItemCollection();
                    items.Add("1", "", "M1", "", "", "", null);
                    items.Add("2", "", "M2", "", "", "", null);
                    items.Add("3", "", "M3", "", "", "", null);
                    _MenuItems = items;
                }
                return _MenuItems;
            }
        }

        #endregion
        #region SelectedMenuItem

        private Sidvall.UI.Entities.MenuItem _SelectedMenuItem;
        public Sidvall.UI.Entities.MenuItem SelectedMenuItem
        {
            get
            {
                return _SelectedMenuItem;
            }
            set
            {
                _SelectedMenuItem = value;
                RaisePropertyChanged(nameof(SelectedMenuItem));
            }
        }

        #endregion

        #region Start

        public void Start(string title)
        {
            base.Start();

            this.Title = title;
        }

        #endregion

        #endregion
        #region Constructors

        public MainWindowViewModel()
        {
        }

        #endregion
    }
}
